using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Mapping.Attributes;
using Lib;
using Persistance.Model;

namespace Persistance.BLL
{
    public class UserManagement
    {

        public static List<Users> getAllUsers()
        {
            ISession sess = Persistor.CurrentSession;
            try
            {
                IQuery q = sess.CreateQuery("from Users");
                List<Users> results = (List<Users>)q.List<Users>();

                return results;
            }
            catch (Exception e)
            {
                throw new Exception("Error retrieving all users: ", e);
            }
        }
    }
}
